package com.heima.user.feign;

import com.heima.common.dto.ResponseResult;
import com.heima.common.dto.WmNews;
import com.heima.user.dto.WmUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "leadnews-media")
public interface MediaFeignClient {

    /**
     * 创建自媒体用户
     * @param wmUser
     * @return
     */
    @PostMapping("/api/v1/user")
    public ResponseResult<WmUser> saveWmUser(@RequestBody WmUser wmUser);


    /**
     * 更新自媒体用户
     * @param user
     * @return
     */
    @PutMapping("/api/v1/user")
    public ResponseResult updateWmuser(@RequestBody WmUser user);



    @GetMapping("/api/v1/news/cha")
    public ResponseResult cha( @SpringQueryMap WmNews wmNews);

}
